package com.ruoyi.demo.controller;

import com.ruoyi.demo.service.MeetingSummaryService;
import com.ruoyi.demo.service.VideoProcessingService;
import com.ruoyi.system.domain.MeetMaterials;
import com.ruoyi.system.mapper.MeetMaterialsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 33692
 */

@RestController
@RequestMapping("/demo/DeepTestController")
public class DeepTestController {

    @Autowired
    private VideoProcessingService videoProcessingService;

    @Autowired
    private MeetingSummaryService meetingSummaryService;

    @Autowired
    private MeetMaterialsMapper meetMaterialsMapper;

    @GetMapping("/{meetId}")
    public void testVideoProcessingService(@PathVariable("meetId") Long meetId){
        MeetMaterials meetMaterials = meetMaterialsMapper.selectMeetMaterialsById(meetId);
        videoProcessingService.splitVideoByAgenda(meetMaterials,"D:\\ffmpeg\\meetVideo_20_20250219160605634.mp4","D:\\ffmpeg\\meetAudio_20_20250219162104904.mp3");
    }

    @GetMapping("/summary/{meetId}")
    public void testMeetingSummaryService(@PathVariable("meetId") Long meetId){
        MeetMaterials meetMaterials = meetMaterialsMapper.selectMeetMaterialsById(meetId);
        meetingSummaryService.generateSummary(meetMaterials);
    }


}
